package com.somlsis.activity

import com.base.BaseActivity
import com.github.mikephil.charting.components.XAxis
import com.github.mikephil.charting.components.XAxis.XAxisPosition
import com.github.mikephil.charting.data.BarEntry
import com.somlsis.R
import com.somlsis.bean.UserOverview
import com.somlsis.databinding.ActivityDataStatisticsBinding

/**
 * 数据统计
 */
class DataStatisticsActivity : BaseActivity<ActivityDataStatisticsBinding>() {
    private val userOverview: UserOverview? = null
    override fun getViewBinding(): ActivityDataStatisticsBinding {
        return ActivityDataStatisticsBinding.inflate(layoutInflater)
    }

    override fun createView() {
        binding.layoutTitle.title.text = getString(R.string.data_statistics)
        binding.layoutTitle.back.setOnClickListener { finish() }

        createChart()
    }

    private fun createChart() {
        binding.chart.description.isEnabled = false

        binding.chart.setMaxVisibleValueCount(60)

        binding.chart.setPinchZoom(false)

        binding.chart.setDrawBarShadow(false)
        binding.chart.setDrawGridBackground(false)
        val xAxis: XAxis = binding.chart.xAxis
        xAxis.position = XAxisPosition.BOTTOM
        xAxis.setDrawGridLines(false)

        binding.chart.axisLeft.setDrawGridLines(false)


        binding.chart.animateY(1500)

        binding.chart.legend.isEnabled = false
    }

    private fun week() {

    }
    private fun month(){

    }
    private fun year(){

    }
    private fun sum(){

    }
}